<template>
    <view class="container">
    </view>
</template>

<script lang="ts" setup>
    import { onLoad } from '@dcloudio/uni-app'
    import { useGlobalStore } from '@/stores/global'
    import Settings from '@/config/settings'
    import Func from '@/utils/functions'

    const global = useGlobalStore()

    onLoad(async () => {
        try {
            Func.showLoading()
            if (!global?.user?.id) {
                Func.redirectTo({
                    url: Settings.loginPath
                })
            } else {
                Func.switchTab({ url: Settings.homePath })
            }
        } catch (error) {
            console.log(error)
        } finally {
            Func.hideLoading()
        }
    })
</script>

<style lang="scss" scoped>

</style>